package org.fly.jingwei.dao;

import org.fly.jingwei.entity.JobTimeSchedulerEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author cRAZY
 * @date 2017/3/6
 */
@Repository
public interface JobSchedulerDao {
    /**
     *
     * @param userGroupName
     * @return
     */
    List<JobTimeSchedulerEntity> getAllTimerJob(String userGroupName);

    /**
     *
     * @param job
     */
    void addTimerJob(JobTimeSchedulerEntity job);

    /**
     *
     * @param typeId
     * @param slaves
     * @param jobName
     * @param userGroupName
     * @return
     */
    Integer getTotalCount(Integer typeId, String slaves, String jobName, String userGroupName);

    /**
     *
     * @param start
     * @param limit
     * @param typeId
     * @param slaves
     * @param jobName
     * @param userGroupName
     * @return
     */
    List<JobTimeSchedulerEntity> getTimerJobByPage(int start, int limit, Integer typeId, String slaves, String jobName, String userGroupName);

    /**
     *
     * @param taskId
     */
    void deleteScheduler(long taskId);

    /**
     *
     * @param taskId
     * @return
     */
    JobTimeSchedulerEntity getSchedulerBytaskId(long taskId);

    /**
     *
     * @param schedulerJob
     */
    void updateScheduler(JobTimeSchedulerEntity schedulerJob);

    /**
     *
     * @param jobName
     */
    void deleteSchedulerByJobName(String jobName);

    /**
     *
     * @param jobName
     * @return
     */
    List<JobTimeSchedulerEntity> getTimerJobByJobName(String jobName);

}
